import type { Ref,InjectionKey } from 'vue'
export type NameType = string|number

export interface CollapseProps{
  // v-module拆出来的
  modelValue: NameType[];
  accordion?: boolean;
}
export interface CollapseItemProps{
  name: NameType;
  title?: string;
  disabled?: boolean;
}
export interface CollapseContext{
  activeNames: Ref<NameType[]>;
  handleItemClick: (name: NameType)=>void;
}
export interface CollapseEmits {
  // v-module拆出来的
  (e: 'update:modelValue', values: NameType[]) : void;
  (e: 'change', values: NameType[]) : void;
}

// InjectionKey 类型和 Symbol 来创建一个唯一的标识符，以便在父组件和子组件之间共享数据
export const collapseContextKey: InjectionKey<CollapseContext> = Symbol('collapseContextKey')